//
//  CheckBox.h
//  yuikemall
//
//  Created by yuike6 yuike6 on 12-2-27.
//  Copyright (c) 2012年 yuike. All rights reserved.
//


/*
 
 CheckBox * c = [[CheckBox alloc] initWithFrame:CGRectMake(10, 10, 100, 100) style:kCheckBoxViewStyleBox checked:NO];
 
 [self.view addSubview:c];
 
 [c setText:@"Some other item"];
 [c setStateChangedTarget:self
 selector:@selector(checkBoxViewChangedState:)];
 
 */
#import "UIViewEx.h"

typedef enum CheckBoxViewStyle_ {
    kCheckBoxViewStyleBox = 0,
    kCheckBoxViewStyleDark,
    kCheckBoxViewStyleGlossy,
    kCheckBoxViewStyleGreen,
    kCheckBoxViewStyleMono,
    
    kCheckBoxViewStylesCount
} CheckBoxViewStyle;

@interface CheckBox : UIViewEx
{
    SEL stateChangedSelector;
    id<NSObject> delegate;
    
    UIImageView *checkBoxImageView;
    UILabel *textLabel;
    
    CheckBoxViewStyle style;
    BOOL checked;
}

@property (nonatomic, readonly) CheckBoxViewStyle style;
@property (nonatomic, readonly) BOOL checked;

- (id) initWithFrame:(CGRect)frame
               style:(CheckBoxViewStyle)aStyle
             checked:(BOOL)aChecked;

- (void) setText:(NSString *)text;

- (void) setChecked:(BOOL)isChecked;

- (void) setStateChangedTarget:(id<NSObject>)target
                      selector:(SEL)selector;
@end
